package com.tailyou.hms.firstapp.act;

import android.net.Uri;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.tailyou.hms.firstapp.wdg.CustomVideoView;
import com.tailyou.hms.firstapp.R;

public class CustomVideoActivity extends AppCompatActivity {

    private CustomVideoView cvv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_custom_video);
        cvv = findViewById(R.id.cvv);
        //Uri uri = Uri.parse("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4");
        // 本地raw下视频
        Uri uri = Uri.parse("android.resource://com.tailyou.hms.firstapp/" + R.raw.big_buck_bunny);
        cvv.setVideoURI(uri);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        cvv.destroy();
    }

}